home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_6.zip / INT.C < prev    next >
C/C++ Source or Header  |  1993-02-05  |  2KB  |  59 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #include <stdio.h>
  21. #include <conio.h>
  22. #include <dos.h>
  23. #include <stk.h>
  24. #include <i32.h>
  25.  
  26. #pragma interrupt (AVL_INT23)
  27. void AVL_INT23();               /* User Int 23h protected-mode interrupt handler */
  28.  
  29. void (*AVL_PREV_INT23)();             /* Previous Int 23h protected-mode handler */
  30.  
  31.  
  32. void AVL_INSTALL_I23()               /* Control-C Protected-Mode Handler Example */
  33. {
  34.    AVL_PREV_INT23 = _dos_getvect ( 0x23u  );    /* Save previous handler pointer */
  35.    _dos_setvect ( 0x23u, AVL_INT23 );            /* Install user Int 23h handler */
  36. }
  37.  
  38. void AVL_RESTORE_I23()
  39. {
  40.    _dos_setvect ( 0x23u, AVL_PREV_INT23 );           /* Restore previous handler */
  41. }
  42.  
  43.  
  44. void AVL_INT23 ( void )         /* User Int 23h Protected-Mode Interrupt Handler */
  45. {
  46.    extern int avl_ctrl_c;
  47.    _XSTACK *ebp;                            /* Real-mode handler stack frame */
  48.  
  49.    ebp = (_XSTACK *) _get_stk_frame();           /* Get stack frame address */
  50.  
  51. /*   avl_ctrl_c = 1;   */
  52.  
  53.          /* Perform interrupt handling services, ie, ignore Control-C */
  54.  
  55.    ebp->opts |= _STK_NOINT;                      /* Bypass real-mode handler */
  56. }
  57.  
  58.  
  59.